/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Ram
 */
public class Triangulo {
    //ATRIBUTOS
    private double base;
    private double altura;
    private double area;
    private double perimetro;
    
    //CONSTRUCTORES
    
    public Triangulo(){
        base=5;
        altura=2;
         area=calcularArea();
       perimetro=calcularPerimetro();
        
    }
    public Triangulo(double b, double a){
        base=b;
        altura=a;
         area=calcularArea();
       perimetro=calcularPerimetro();
        
    }

    // GETTERS & SETTERS
    public double getBase() {
        return base;
    }

    public void setBase(double b) {
        base = b;
    }

    public double getAltura() {
        return altura;
    }

    public void setAltura(double al) {
        altura = al;
    }


    //METODOS
    public double calcularPerimetro()
    {
        perimetro=base*3;
        return perimetro;
    }
    public double calcularArea()
    {
        area=(base*altura)/2.0;
        return area;
    }
     public void imprimirInfo()
    {
        System.out.println("Informacion del Triangulo ");
        System.out.println(" -------------------------- ");
        System.out.println("Base: " + base );
        System.out.println("Altura: " + altura );
        System.out.println("Area: " + area );
        System.out.println("Perimetro: " + perimetro );
    }
    
}
